home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)TB / (A)TBE.ADF / Utility / LS_source / ls.h next >
C/C++ Source or Header  |  1990-08-26  |  4KB  |  141 lines

  1. /*
  2.  * ls.h - header file for a UNIX-like directory utility
  3.  *
  4.  * ls v4.0k is (c) Copyright 1990, Kim E. DeVaughn, all rights reserved.
  5.  *
  6.  */
  7.  
  8. /* Prevent Lint from complaining about ANSI prototype extensions */
  9. #ifdef _lint
  10.  
  11. #define __asm
  12. #define __stdargs
  13. #define __regargs
  14. #define R_D0
  15. #define R_D1
  16. #define R_A0
  17.  
  18. #else
  19.  
  20. #define R_D0    register __d0
  21. #define R_D1    register __d1
  22. #define R_A0    register __a0
  23.  
  24. #endif
  25.  
  26. /* Use Real strlen unless you comment out the following */
  27. #define strlen strlen
  28.  
  29. #include <dos.h>
  30. #include <libraries/dosextens.h>
  31.  
  32. /*lint -save    */
  33. /*lint -library */
  34. #include <stdio.h>
  35. #include <string.h>
  36. #include <stdlib.h>
  37. #include <signal.h>
  38. #include <proto/exec.h>
  39. #include <proto/dos.h>
  40. /*lint -restore */
  41.  
  42. extern int tolower (char);
  43.  
  44. #define MEMF_PUBLIC (1L << 0)
  45. #define MEMF_CHIP   (1L << 1)
  46. #define MEMF_FAST   (1L << 2)
  47. #define MEMF_CLEAR  (1L << 16)
  48.  
  49. #define SUPPRESS_ERR_REQ (void *)-1L
  50.  
  51. /* usage defines ... error codes eventually reported to the OS as DOS #120's */
  52. #define SYNTAX         0L
  53. #define ILLEGAL_ARG  120000L
  54. #define MISSING_ARG  120010L
  55. #define PATTERN_ERR  120020L
  56. #define WILDSPEC_ERR 120030L
  57.  
  58. /* Structure used to hold file info in a linked list */
  59. struct FibEntry
  60. {
  61.   struct MinNode fe_Node;
  62.   struct FileInfoBlock *fe_Fib;
  63. };
  64.  
  65. typedef struct FileInfoBlock FIB;
  66. typedef struct FileLock      FLK;
  67. typedef struct InfoData      ID;
  68.  
  69. #define  MAX_BLKS_PER_EXTENT  72
  70.  
  71. /* Maximum number of command line args, buffer sizes, etc. */
  72. #define MAXARG         32
  73. #define MAXDEPTH  0x7fffffff
  74. #define MAXFNLEN     30
  75. #define PADTABSIZE  100
  76. #define WORKSIZE    300
  77.  
  78. /* Flag bits for LSFlags and LSFlagsX */
  79. #define BREAKFLAG    (1L << 0)
  80. #define CONSOLE     (1L << 1)
  81. #define SHOWDIRS    (1L << 2)
  82. #define SHOWFILES    (1L << 3)
  83. #define LISTALL     (1L << 4)
  84. #define LONGLIST    (1L << 5)
  85. #define NOSORTFLAG    (1L << 6)
  86. #define NOTEFLAG    (1L << 7)
  87. #define PATHNAMED    (1L << 8)
  88. #define REVFLAG     (1L << 9)
  89. #define WILDPATH    (1L << 10)
  90. #define FULLPATHNAMES    (1L << 11)
  91. #define ANTIMATCH    (1L << 12)
  92. #define TOTALIZE    (1L << 13)
  93. #define NOHEADERS    (1L << 14)
  94. #define NOINTERACT    (1L << 15)
  95. #define FILESFIRST    (1L << 16)
  96. #define SEPFILESDIRS    (1L << 17)
  97. #define SHOWOLDERTHAN    (1L << 18)
  98. #define SHOWNEWERTHAN    (1L << 19)
  99. #define IGNORECASELIST    (1L << 20)
  100. #define IGNORECASEWILD    (1L << 21)
  101. #define MATCHDOTFILES    (1L << 22)
  102. #define MATCHINFOFILES    (1L << 23)
  103. #define SHOWHIDDEN    (1L << 24)
  104. #define OLDLONGFORMAT    (1L << 25)
  105. #define VARCOLSFORMAT    (1L << 26)
  106. #define ONECOLFORMAT    (1L << 27)
  107. #define ADDDIRSLASH    (1L << 28)
  108. #define SHOWDISKKEYS    (1L << 29)
  109. #define RELPATHNAMES    (1L << 30)
  110. #define NODIRTOTAL    (1L << 31)
  111. #define WILDPATHFLAG    (1L << 32 - 32)
  112. #define SINGLEFILEFLAG    (1L << 33 - 32)
  113. #define DATABLKSONLY    (1L << 34 - 32)
  114. #define NOWILDPATHDIRS    (1L << 35 - 32)
  115. #define EMPTYDIRFLAG    (1L << 36 - 32)
  116. #define NOTFOUNDHALT    (1L << 37 - 32)
  117. #define NOFIXNUMBLOCKS    (1L << 38 - 32)
  118.  
  119.  
  120. /* defines for datestr()   */
  121.  
  122. #define  TIME_YEAR_THRESHOLD  180   /*    days for  AGE_TO_YEARS    format    */
  123.                     /*    change -----v    d = space or D    */
  124. #define  AGE_TO_YEARS    0    /*   MMM dD HH:MM   or     MMM dD  YYYY    */
  125. #define  FULL_FORM    1    /*   MMM DD YYYY  HH:MM:SS        */
  126. #define  DASHA_FORM    2    /*   DD-MMM-YY HH:MM:SS         */
  127. #define  DASHN_FORM    3    /*   MM-DD-YY HH:MM:SS            */
  128. #define  SLASH_FORM    4    /*   MM/DD/YY HH:MM:SS            */
  129. #define  EURO_FORM    5    /*   DD/MM/YY HH:MM:SS            */
  130. #define  DOT_FORM    6    /*   YY.MM.DD HH:MM:SS            */
  131.  
  132.  
  133. /* defines for attrstr()    */
  134.  
  135. #define  FIBB_HIDDEN    7   /*    not in 1.3 includes, but works with Protect  */
  136. #define  FIBF_HIDDEN    (1 << FIBB_HIDDEN)
  137.  
  138. #define  FIBF_RESERVED    ~(FIBF_HIDDEN  | FIBF_SCRIPT | FIBF_PURE  |   \
  139.               FIBF_ARCHIVE | FIBF_READ   | FIBF_WRITE |   \
  140.               FIBF_EXECUTE | FIBF_DELETE)
  141.